'use strict'

const debug = require('debug');

module.exports = function setup(name) {
  const _error = debug(`[${name}] ERROR`);
  _error.log = console.error.bind(console);
  _error.enabled = true;

  const _warn = debug(`[${name}] WARN`);
  _warn.log = console.warn.bind(console);
  _warn.enabled = true;

  const _log = debug(`[${name}] `);
  _log.log = console.log.bind(console);
  _log.enabled = true;

  const _debug = debug(`[${name}] DEBUG`);
  _debug.log = console.debug.bind(console);
  _debug.enabled = true;

  return {
    error: _error,
    warn: _warn,
    info: _log,
    log: _log,
    debug: _debug,
  }
};
